﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WpfWebBrowser
{
   public class Common
    {
        public static void WriteToLog(string msg)
        {
            if (!System.IO.Directory.Exists("c:\\Log"))
            {
                System.IO.Directory.CreateDirectory("c:\\Log");
            }
            DateTime now = DateTime.Now;
            string logpath = string.Format(@"c:\Log\异常日志{0}_{1}_{2}.log", now.Year, now.Month, now.Day);
            msg = string.Format("\r\n--{0}--------------------------\r\n{1}\r\n\r\n\r\n",
                now.ToString("yyyy-MM-dd HH:mm:ss"), msg);
            System.IO.File.AppendAllText(logpath, msg);
        }
    }
}
